import { OrgServiceApi, WorkflowServiceApi } from "./_workflow";
import { AxiosResponse } from "axios";
import { objectToUrlParams } from "/@/utils/common";
import service from "/@/utils/request";

class RemoteSelectServiceApi extends OrgServiceApi { }

export const ExportRemoteSelectServiceApi = new RemoteSelectServiceApi(
  "/JxudpApplicationService"
);

class WorkFlowTypeServiceApi extends WorkflowServiceApi { }

export const ExportWorkTypeServiceApi = new WorkFlowTypeServiceApi(
  '/WorkFlowTypeService'
)

class WorkFlowModuleBeanServiceApi extends OrgServiceApi {
  upDateOrderNum(bean: any, params?: any): Promise<AxiosResponse<any>> {
    let url = this.baseUrl + "/upDateOrderNum";
    url += objectToUrlParams(params, true);
    return service.post(url, bean);
  }
}

export const ExportWorkFlowModuleBeanServiceApi = new WorkFlowModuleBeanServiceApi(
  '/ModuleBeanService'
)
class CompMetadataServiceApi extends OrgServiceApi {
  getMetaDataByCompAndObjCode(bean: any, params?: any): Promise<AxiosResponse<any>> {
    let url = this.baseUrl + "/getMetaDataByCompAndObjCode";
    url += objectToUrlParams(params, true);
    return service.get(url, { params: { ...bean } });
  }
}

export const ExportCompMetadataServiceApi = new CompMetadataServiceApi(
  '/CompMetadataService'
)
